//
//  ProductEntity.m
//  SXH
//
//  Created by Jack on 15/12/15.
//  Copyright (c) 2015年 lyss. All rights reserved.
//

#import "ProductEntity.h"

@implementation ProductEntity

- (instancetype)initWithAttributes:(NSDictionary *)attributes
{
    self = [super init];
    if (!self) {
        return nil;
    }
    
    self.park_id= [NSString stringWithFormat:@"%@",[attributes valueForKeyPath:@"park_id"]];
    self.park_name= [attributes valueForKeyPath:@"park_name"];
    self.product_class_id= [NSString stringWithFormat:@"%@",[attributes valueForKeyPath:@"product_class_id"]];
    self.product_id = [NSString stringWithFormat:@"%@",[attributes valueForKeyPath:@"product_id"]];
    self.product_title = [attributes valueForKeyPath:@"product_title"];
    self.old_price= [NSString stringWithFormat:@"%@",[attributes valueForKeyPath:@"old_price"]];
    self.sale_price = [NSString stringWithFormat:@"%@",[attributes valueForKeyPath:@"sale_price"]];
    self.ship_cost = [NSString stringWithFormat:@"%@",[attributes valueForKeyPath:@"ship_cost"]];
    self.album = [NSString stringWithFormat:@"%@/%@", IMAGE_URL,[attributes valueForKeyPath:@"album"]];
    self.album_thumb = [NSString stringWithFormat:@"%@/%@", IMAGE_URL,[attributes valueForKeyPath:@"album_thumb"]];
    self.pro_name = [attributes valueForKeyPath:@"pro_name"];
    self.city_name = [attributes valueForKeyPath:@"city_name"];
    self.descriptionInfo = [attributes valueForKeyPath:@"description"];
    self.star = [NSString stringWithFormat:@"%@",[attributes valueForKeyPath:@"star"]];
    self.product_introduce = [NSString stringWithFormat:@"%@/%@",IMAGE_URL,[attributes valueForKeyPath:@"product_introduce"]];
    self.product_attr = [attributes valueForKeyPath:@"product_attr"];
    self.comment_list = [attributes valueForKeyPath:@"comment_list"];
    self.use_start_date = [attributes valueForKeyPath:@"use_start_date"];
    self.use_end_date = [attributes valueForKeyPath:@"use_end_date"];
    self.order_last_time = [attributes valueForKeyPath:@"order_last_time"];
    
    return self;
}

@end
